package cn.tedu.tmall.admin.mall.service;

import cn.tedu.tmall.admin.mall.pojo.param.CategoryAddParam;
import cn.tedu.tmall.admin.mall.pojo.vo.CategoryTreeVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Transactional  //也行 整个接口的方法都有事务
public interface ICategoryService {

    @Transactional  //推荐
    void addCategory(CategoryAddParam categoryAddParam);


    List<CategoryTreeVO> treeCategory();

    /**
     * 获取所有的顶级类别
     * @return
     */
    List<CategoryTreeVO> topTreeCategory();

    /**
     * 通过类别ID获取子类别
     * @param id
     * @return
     */
    List<CategoryTreeVO> childrenTreeCategory(Long id);

    List<CategoryTreeVO> treeCategoryFromCache();

    void initCategoryToCache();

    List<CategoryTreeVO> childrenTreeCacheCategory(Long id);

    List<CategoryTreeVO> topTreeCacheCategory();


    //void addCategory(CategoryPO categoryPO);
}
